namespace EOSDigital.SDK
{
	public struct Rational
	{
		public int Numerator;

		public int Denominator;

		public static implicit operator double(Rational val)
		{
			return (double)val.Numerator / (double)val.Denominator;
		}

		public static implicit operator decimal(Rational val)
		{
			return (decimal)val.Numerator / (decimal)val.Denominator;
		}

		public static bool operator ==(Rational x, Rational y)
		{
			if (x.Numerator == y.Numerator)
			{
				return x.Denominator == y.Denominator;
			}
			return false;
		}

		public static bool operator !=(Rational x, Rational y)
		{
			return !(x == y);
		}

		public override bool Equals(object obj)
		{
			if (obj is Rational)
			{
				return this == (Rational)obj;
			}
			return false;
		}

		public override int GetHashCode()
		{
			int num = -2128831035;
			num *= (0x1000193 ^ this.Numerator.GetHashCode());
			return num * (0x1000193 ^ this.Denominator.GetHashCode());
		}

		public override string ToString()
		{
			return this.Numerator + "/" + this.Denominator;
		}
	}
}
